﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter09.Code01.Code03.Snippet05
{
    class MyClass
    {
        private int myInt;

        public int Myint
        {
            get { return myInt; }
            set 
            {
                if (value >= 0 && value <= 10)
                    myInt = value;
                else
                    throw (new ArgumentOutOfRangeException("MyIntProp", value, "MyIntProp must be assigned a value between 0 and 10."));
            }
        }
    }
}
